package classesdemo;

import inheritence.Parent;

/**
 * Created by pc on 2015/2/12.
 * 对于protected，包外普通类不能访问*
 */
public class BaoWaiSon extends Parent {
    @Override
    protected void overideThis() {
        System.out.println("包外子类也能访问哦");
    }

}

class BaoWai{
    public void accessOverideThis(){
        Parent pa = new Parent();
        System.out.println(pa.bookName);
        //包外普通类是访问不到的
//        pa.overideThis();
        
    }
    
    public static void main(String args[]){
        BaoWai bw = new BaoWai();
        bw.accessOverideThis();
        BaoWaiSon bws = new BaoWaiSon();
        bws.overideThis();
        
    }
    
}
